#include <iostream>
using namespace std;

string cache[100];

string fibo(int n){
       string out="";

      if(cache[n] != ""){
          return cache[n];
      }else{
          if(cache[n-1] == ""){
             cout << "_"<<n-1<<endl;
            cache[n-1] = fibo(n-1);
          }
          out = cache[n-7] + cache[n-8] + cache[n-7]+cache[n-8] + cache[n-9] + cache[n-8]+cache[n-7] + cache[n-8] + cache[n-7];  
       }
  cout << out.size()<<endl;
      return out;
}

int main(){
       cache[0]="0";
       cache[1]="1";
       cache[2]="10";
       cache[3]="101";
       cache[4]="10110";
       cache[5]="10110101";
       cache[6]="1011010110110";
       cache[7]="101101011011010110101";
       cache[8]="1011010110110101101011011010110110";
       cache[9]="1011010110110101101011011010110110101101011011010110101";
  int a;
  cin >> a; 
  string salida = fibo(a);
  //system("PAUSE");
  return 0;
}

